﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OSM
{
	public partial class Form1 : Form
	{
		OSMServer Server;
		OSMData D = new OSMData();

		const int REL_HUNGARY = 21335;
		OSMRelation Country;
		public Form1()
		{
			InitializeComponent();

			Server = new OSMServer(49998);
			Server.OnLoad += new OSMClientEvent(Server_OnLoad);
			Server.OnReset += new OSMClientEvent(Server_OnReset);
			Server.Start();
		}

		void Server_OnReset(OSMClient C)
		{
			Console.WriteLine("Reset Request from " + C.ClientHeader);
		}

		void Server_OnLoad(OSMClient C)
		{
			Console.WriteLine("Load Request from " + C.ClientHeader);
			D.Load();
			Console.WriteLine("Data Loaded");
			Country = D.RelID[REL_HUNGARY];
		}

		private void button1_Click(object sender, EventArgs e)
		{
			
		}
	}
}
